using namespace std;
#ifndef _ANIMATION_H_H_
#define _ANIMATION_H_H_
#include <list>
#include <Windows.h>
#include "ScreenH.h"
#include "RectangleH.h"
#include "Circle_H.h"
//#define MAX_SCR_LEN 24
#define MAX_SCR_WIDTH 79
#define MIN_SCR_WIDTH 0
#define MIN_SCR_LEN 0

class Animation
{
	Screen Screen1, Screen2;
	Screen * newScreen, * oldScreen;

	list<Rectangl *> Ltemp; 
	list <Circle *> LtempCircles; // change to shape

public:
	//Animation Method Declaration
	Animation::Animation(){newScreen = &Screen1; oldScreen = &Screen2;}
	Animation::~Animation(); // destructor

	void AnimationWithClashes(const list<Rectangl *> & l, int drawingOption);
	void AnimationWithoutClashes(const list<Rectangl *> & l, int drawingOption);
	void createCopiedTempList(const list<Rectangl *> & l);
	bool isDirectionsResetBorders(Rectangl * r);
	bool isDirectionsResetRectangles(Rectangl * r, Rectangl * i);
	void printingDiff();
	int inBorder(Rectangl * r); // counts how many points are in the border limits
	bool isInBorder(Point *p); //tells you if a Point isInBorder or not.
	void isDirectionsResetRectangles2(int &x, int &y, Rectangl * r, list<Rectangl*>::iterator i);
	void bordersSecureFunc(int &dirX, int &dirY, Rectangl * r);
	void isDirectionsResetRectangleBorders(Rectangl * r, Rectangl * i);
	void calculateMaxMinBorders(Rectangl * r, int &max_limit_x, int &max_limit_y, int &min_limit_x, int &min_limit_y);
	void getPosPointByDirection(int &r_posX, int &r_posY, int r_dir_x, int r_dir_y, Rectangl * r);
	bool isDirectionsResetRectangleWithRectangle(Rectangl * r, Rectangl * i);
	bool isDirectionsResetRectangleWithRectanglePrevious(Rectangl * r, Rectangl * i);
	void isDirectionsResetRectangleBordersCheckLimits(int r_posX, int r_posY, int r_dir_x, int r_dir_y, Rectangl * r, Rectangl * i);


	void AnimationWithClashesCircles(const list<Circle *> & l, int drawingOption);
	void createCopiedTempListCircles(const list<Circle *> & l);
	bool isDirectionsResetBordersCircles(Circle * c);
	bool isDirectionsResetBordersCirclesPerPoint(Circle * c, Point p);
	bool isDirectionsResetCircles(Circle * c, Circle * c2);
	void isDirectionsResetCircleClahsedWithCircle(Circle * c, Circle * c2);

	
	void AnimationWithClashesPoly(list<Shape *> l, int drawingOption);
	void AnimationWithoutClashesPoly(list<Shape *> & lst, int drawingOption);
	void isDirectionsResetRectanglesCircles(Rectangl * r, Circle * c2);
	void addTimeToShapeAnim(list<Shape*> &lst);
	void applySplitShapeScr(list<Shape*> &lst);
	void initSum(list<Shape*> &lst);



};



#endif
